import Vue from 'vue'
import App from './App'
import store from './store/index'
// import fly from "./common/fly"
import fly from "./common/fly-shiro"
import lodash from 'lodash'


  Vue.prototype.$lodash = lodash

  const tui = {
    // 提示框
    toast(text, duration, success) {
      uni.showToast({
        title: text,
        icon: success ? 'success' : 'none',
        duration: duration || 2000
      })
    },
    // 跳转
    toPage(url) {
      uni.navigateTo({
        url: url
      })
    },
    // 二维码
    px(num) {
      return uni.upx2px(num) + 'px';
    },
    isLogin() {
      return !!uni.getStorageSync('token')
    },
    log(label, val) {
      console.log("label -> ", val)
    }
  };

Vue.prototype.tui = tui;
Vue.prototype.$request = fly;
Vue.config.productionTip = false;

Vue.prototype.$store = store;


App.mpType = 'app';

const app = new Vue({
  store,
  ...App
});
app.$mount();